<?php
/**
 * Created by PhpStorm.
 * User: Dell
 * Date: 2019-3-6
 * Time: 14:24
 */

namespace app\admin\controller;


use app\common\model\MemberModel;

class Member extends Base
{

    //会员展示
    public function index(){
        if (request()->isAjax()){
            $param = input("param.");

            $limit = $param['pageSize'];
            $offset = ($param['pageNumber'] - 1) * $limit;

            $where = [];
            if (!empty($param['searchText'])) {
                $where['memb_name'] = ['like', '%' . $param['searchText'] . '%'];
            }

            $goods = new MemberModel();
            $selectResult = $goods->getMemberByWhere($where, $offset, $limit);


            $return['total'] = $goods->getAllMember($where);  // 总数据
            $return['rows'] = $selectResult;

            return json($return);
        }
        return $this->fetch();

    }

}